/*
 * Copyright (c) 2008, Xiong Yingfei, the University of Tokyo
 * All rights reserved.
 */
package ac.jp.u_tokyo.SyncLib.dictionaries;


public class RandomIntegerKeyFactory implements KeyFactory<Integer>
{
	public Integer createNewKey(Iterable<Integer> existingKeys)
	{
		Integer max = new Integer(0);
		for (Integer key : existingKeys)
			if (key.intValue() > max.intValue()) max = key; 
		return max + 1;
	}
	
	public static RandomIntegerKeyFactory INSTANCE = new RandomIntegerKeyFactory();

}
